#include <stdio.h>

int main()
{
    int a[10][10] = {0};

    for (int i = 0; i < 10; i++) // row
    {
        a[i][0] = 1;
        a[i][i] = 1;
    }
    for (int i = 2; i < 10; i++) // row
    {
        for (int j = 1 ; j <=i-1; j++) // column
        {
            a[i][j] = a[i - 1][j - 1] + a[i - 1][j];
        }
    }
    for (int i = 0; i < 10; i++)
    {
        for(int k=0;k<10-i;k++)
            printf(" ");
        for (int j = 0; j <=i; j++)
        {
            printf("%3d ", a[i][j]);
        }
        printf("\n");
    }
    return 0;
}